rc |= iomem_deny_access(dom0, mfn, mfn);
}
+ /* Remove access to E820_UNUSABLE I/O regions. */
+ for ( i = 0; i < e820.nr_map; i++ )
+ {
+ if ( e820.map[i].type != E820_UNUSABLE)
+ continue;
+ mfn = paddr_to_pfn(e820.map[i].addr);
+ nr_pages = (e820.map[i].size + PAGE_SIZE - 1) >> PAGE_SHIFT;
+ rc |= iomem_deny_access(dom0, mfn, mfn + nr_pages - 1);
+ }
+
BUG_ON(rc != 0);
return 0;
(unsigned long long)(map[i].addr),
(unsigned long long)(map[i].addr + map[i].size));
switch (map[i].type) {
- case E820_RAM: printk("(usable)\n");
+ case E820_RAM:
+ printk("(usable)\n");
break;
case E820_RESERVED:
printk("(reserved)\n");
case E820_NVS:
printk("(ACPI NVS)\n");
break;
- default: printk("type %u\n", map[i].type);
+ case E820_UNUSABLE:
+ printk("(unusable)\n");
+ break;
+ default:
+ printk("type %u\n", map[i].type);
break;
}
}
/* Any areas not specified as RAM by the e820 map are considered I/O. */
for ( i = 0, pfn = 0; pfn < max_page; i++ )
{
- while ( (i < e820.nr_map) && (e820.map[i].type != E820_RAM) )
+ while ( (i < e820.nr_map) &&
+ (e820.map[i].type != E820_RAM) &&
+ (e820.map[i].type != E820_UNUSABLE) )
i++;
if ( i >= e820.nr_map )
((u64)map->base_addr_high << 32) | (u64)map->base_addr_low;
e820_raw[e820_raw_nr].size =
((u64)map->length_high << 32) | (u64)map->length_low;
- e820_raw[e820_raw_nr].type =
- (map->type > E820_NVS) ? E820_RESERVED : map->type;
+ e820_raw[e820_raw_nr].type = map->type;
e820_raw_nr++;
bytes += map->size + 4;
#define E820_RESERVED 2
#define E820_ACPI 3
#define E820_NVS 4
+#define E820_UNUSABLE 5
struct e820entry {
uint64_t addr;